package com.simple.gateway.test.provider.interfaces.impl;

import com.alibaba.fastjson.JSON;
import com.simple.gateway.sdk.annotation.ApiProducerClazz;
import com.simple.gateway.sdk.annotation.ApiProducerMethod;
import com.simple.gateway.test.provider.rpc.IActivityBooth;
import com.simple.gateway.test.provider.rpc.dto.UserRequestDTO;
import org.apache.dubbo.config.annotation.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 项目: simple-gateway-core
 *
 * 功能描述: 实现
 *
 * @author: WuChengXing
 *
 * @create: 2023-08-03 11:39
 **/
@Service(version = "1.0.0")
@ApiProducerClazz(interfaceName = "活动服务", interfaceVersion = "1.0.0")
public class ActivityBoothImpl implements IActivityBooth {

    @Override
    @ApiProducerMethod(methodName = "get方法", uri = "/test/sayHi", httpCommandType = "GET", auth = 0)
    public String sayHi(String str) {
        return "hi " + str + " by simple-gateway-test-provider#sayHi";
    }

    @Override
    @ApiProducerMethod(methodName = "插入方法", uri = "/test/insert", httpCommandType = "POST", auth = 1)
    public String insert(UserRequestDTO req) {
        return "hi " + JSON.toJSONString(req) + " by simple-gateway-test-provider#insert";
    }

    @Override
    @ApiProducerMethod(methodName = "测试方法", uri = "/test/test", httpCommandType = "POST", auth = 0)
    public String test(String str, UserRequestDTO req) {
        return "hi " + str + JSON.toJSONString(req) + " by simple-gateway-test-provider#test";
    }
}
